﻿namespace TagBasedResourceManagePlatform.Database
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.ComponentModel.DataAnnotations;
    using System.ComponentModel.DataAnnotations.Schema;
    using System.Data.Entity;
    using System.Data.Entity.ModelConfiguration;

    public class ThumbnailDB : DbContext
    {
        public ThumbnailDB() : base("name=ThumbnailDB")
        {}

        public virtual DbSet<Thumbnail> Thumbnails { get; set; }
    }

    [Table("Thumbnails")]
    public class Thumbnail
    {
        [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int Id { get; set; }

        [Required,MaxLength(64)]
        public string Format { get; set; }

        [Required]
        public byte[] Data { get; set; }
    }
}
